-- GENERATED SPELL FOR [Magister Aledis] --


function spell0_20159(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(20823,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20159', 3000, 1)
end

function spell1_20159(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_20159', 8270, 1)
end

function spell2_20159(pUnit, Event) --@Pyroblast,n/a--
pUnit:FullCastSpellOnTarget(33975,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20159', 18000, 1)
end

function Sorts_20159(pUnit, Event)
local choix_sorts_20159 = math.random(0, 2)
if choix_sorts_20159 == 0 then
pUnit:RegisterEvent('spell0_20159', 1, 1)
end
if choix_sorts_20159 == 1 then
pUnit:RegisterEvent('spell1_20159', 1, 1)
end
if choix_sorts_20159 == 2 then
pUnit:RegisterEvent('spell2_20159', 1, 1)
end
end

function mob20159_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20159', math.random(1500, 3000), 1)
end

function mob20159_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20159_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20159_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20159, 1, 'mob20159_Action')
RegisterUnitEvent(20159, 2, 'mob20159_Leave')
RegisterUnitEvent(20159, 3, 'mob20159_Kill')
RegisterUnitEvent(20159, 4, 'mob20159_Die')
